package com.foreknow.demo5;

public class Point {
    private int x;
    private int y;

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
    public void movePoint(int dx,int dy){
//        Point a = new Point();
//        a.setX(dx);
//        a.setY(dy);
        this.x += dx;
        this.y += dy;
    }

    public static void main(String[] args) {
        Point p1 = new Point();
        p1.setX(5);
        p1.setY(10);
        p1.movePoint(5,20);
        System.out.println(p1.getX()+"  "+p1.getY());
        Point p2 = new Point();
        p2.movePoint(10,15);
        System.out.println(p2.getX()+"   "+p2.getY());

    }
}
